﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Windows.Data;

using Boggle;

namespace Boggle.Client
{
	[ValueConversion(typeof(Word.Status), typeof(String))]
	public class WordStatusToStringConverter : IValueConverter
	{
		#region IValueConverter Members

		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			var status = (Word.Status)value;

			switch (status)
			{
				case Word.Status.Error:
					return "Error";
				case Word.Status.NotAWord:
					return "Not a word";
				case Word.Status.NotInGrid:
					return "Not found in grid";
				case Word.Status.Validated:
					return "Validated";
				case Word.Status.Validating:
					return "Looking up...";
				default:
					throw new ArgumentException("value was an unsupported Status");
			}
		}

		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}

		#endregion
	}
}
